{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sympy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "x1 = sympy.Symbol('x1')\n",
    "x2 = sympy.Symbol('x2')\n",
    "x3 = sympy.Symbol('x3')\n",
    "x4 = sympy.Symbol('x4')\n",
    "x5 = sympy.Symbol('x5')\n",
    "x6 = sympy.Symbol('x6')\n",
    "x7 = sympy.Symbol('x7')\n",
    "x8 = sympy.Symbol('x8')\n",
    "x9 = sympy.Symbol('x9')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{x1: 0, x2: 0, x3: 0, x4: 1, x5: 1, x6: 0, x7: 0, x8: 1, x9: 1}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sympy.solve([\n",
    "    x1+x2+x4-1,\n",
    "    x1+x2+x3+x5-1,\n",
    "    x2+x3+x6,\n",
    "    x1+x4+x5+x7-2,\n",
    "    x1+x3+x5+x7+x9-2,\n",
    "    x3+x5+x6+x9-2,\n",
    "    x4+x7+x8-2,\n",
    "    x5+x7+x8+x9-3,\n",
    "    x6+x8+x9-2\n",
    "], [x1, x2, x3, x4, x5, x6, x7, x8, x9])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
